package com.example.demospring.service.assistant;

import com.example.demospring.entity.ConsultingAppointment;
import com.example.demospring.repository.ConsultingAppointmentRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class ConsultingAppointmentService {
    @Autowired
    private ConsultingAppointmentRepository repository;

    public List<ConsultingAppointment> findAll() {
        return repository.findAll();
    }

    public List<ConsultingAppointment> findByStatus(ConsultingAppointment.Status status) {
        return repository.findByStatus(status);
    }

    public Optional<ConsultingAppointment> findById(Integer id) {
        return repository.findById(id);
    }

    public ConsultingAppointment save(ConsultingAppointment appointment) {
        return repository.save(appointment);
    }

    public void deleteById(Integer id) {
        repository.deleteById(id);
    }
}